package hbt;
import org.hibernate.*;
import org.hibernate.cfg.*;

public class HibernateUtil {
	private static final SessionFactory sessionFactory;
	static
	{
		try
		{
			AnnotationConfiguration config = new AnnotationConfiguration();
			config.addAnnotatedClass(entities.ContribuyenteBean.class);			
			config.addAnnotatedClass(entities.BienBean.class);			
			config.addAnnotatedClass(entities.ImpuestoBean.class);
			config.addAnnotatedClass(entities.AutomotorBean.class);			
			config.addAnnotatedClass(entities.InmobiliarioBean.class);
			sessionFactory = config.buildSessionFactory();
		}
		catch (Throwable ex)
		{
			System.err.println("Initial SessionFactory creation failed." + ex);
			throw new ExceptionInInitializerError(ex);
		}
	}

	public static SessionFactory getSessionFactory()
	{
		return sessionFactory;

	}

}

